"use strict";

const Mock = require("mockjs");
module.exports = {
  up: (queryInterface, Sequelize) => {
    /*
      Add altering commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.bulkInsert('People', [{
        name: 'John Doe',
        isBetaMember: false
      }], {});
    */

    const data = Mock.mock({
      "rows|500": [
        {
          title: "@ctitle(5, 10)",
          content: "@cparagraph(5, 10)",
          "views|1-100": 50,
          "comments|1-100": 50,
          "likes|1-100": 50,
          "favorites|1-100": 50,
          "author_id|1-100": 50,
          "is_lock|0-1": 0,
        },
      ],
    });
    return queryInterface.bulkInsert("articles", data.rows);
  },

  down: (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.bulkDelete('People', null, {});
    */
    return queryInterface.bulkDelete("articles", null, {});
  },
};
